import React from 'react';
import PropTypes from 'prop-types'
import { Skeleton } from 'antd';

class DepartCatalog extends React.Component{
    static contextTypes = {
        user: PropTypes.string
    }
    
    constructor(props){
        super(props)
        this.state={
            loading:true
        }
    }
    componentDidMount() {
        console.log("demo")
        setTimeout(()=>{
            
            this.setState({loading : false})
        },2000)
    }
    componentWillUnmount = () => {
        this.setState = (state,callback)=>{
          return;
        };
    }
    render(){
        return(
            <div className="flex-container">
                <Skeleton avatar title={false} loading={this.state.loading} active>
                    <div>{this.context.user}</div>
                </Skeleton>
            </div>
        )
    }
}
export {DepartCatalog};